package com.dongbao.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ToolUtils {

    /**
     * 检测文本中是否有中文汉子存在
     *
     */
    public static boolean isContainChinese(String str) {
        Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher m = p.matcher(str);
        if (m.find()) {
            return true;
        }
        return false;

    }

    /**
     * 验证是否是html注释信息
     *
     */
    public static boolean isHTMLCommon(String str) {
        Pattern p = Pattern.compile("<!-{2}.*-{2}>");
        Matcher m = p.matcher(str);
        if (m.find()) {
            return true;
        }
        return false;

    }


}
